UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wX6iCm1tKcYawZJtL1oHy0rKkkr8j/gaoj2RRQZJ2XQ='
WHERE
key_id = 'fc896a88bd87ecd1bee93babdaac4ef4846f77b2814d1d8eaa99a742cba951f0'
AND (
token = 'wX6iCm1tKcYawZJtL1oHy0rKkkr8j/gaoj2RRQZJ2XQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)