UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3o1gMRN1eBiL45c+m1eNDs3J7oiJM8LQ7YUSKDW4EJ8='
WHERE
key_id = '5eb598b48a47245bd1a9ac9bd9b58b6d09ec13ca84a2cdbb57108c5116a7ffd9'
AND (
token = '3o1gMRN1eBiL45c+m1eNDs3J7oiJM8LQ7YUSKDW4EJ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)