UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WGvkmsExqEDzbWLUEt3HNvHG3gDtTZb1c46ktD8pYlE='
WHERE
key_id = '77b81173d876760d74f720317de766597d25eafa98eaba9902c9272bda85cc39'
AND (
token = 'WGvkmsExqEDzbWLUEt3HNvHG3gDtTZb1c46ktD8pYlE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)