UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QEP6nEH5J+kJLSl+KDDl9HQgEbtSgjJ0lGXCn7A7roY='
WHERE
key_id = 'e3545e6d74abf98282c1ea09c4a8b4996836f8be2c53a105608892cd0d1d1e1f'
AND (
token = 'QEP6nEH5J+kJLSl+KDDl9HQgEbtSgjJ0lGXCn7A7roY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)