UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lRVd2dMo85/AtbMVb3b+cVeoZQBkZm99UbHY25DSC6Q='
WHERE
key_id = 'a5dfca1e0af28c8f6d291ea0c355774f82af531302de4aa407fdfbc273a2b00d'
AND (
token = 'lRVd2dMo85/AtbMVb3b+cVeoZQBkZm99UbHY25DSC6Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)