UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5RcEIAmHdzcj9Hg5cHtoQooY5TzIQltg3wCAkfpjLSM='
WHERE
key_id = 'da0bb90181eb175c55299a66635a10a0cc004b8684191a4588ff0c3fe8d2d069'
AND (
token = '5RcEIAmHdzcj9Hg5cHtoQooY5TzIQltg3wCAkfpjLSM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)