UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ihZ+xy0PxU7G8hPlxV/klZTn/w5a8GexOaesYwqpGaA='
WHERE
key_id = '1c3d00dd002ec3e8565f72cf2b0a05dbfc2f62b6e95d3386a23b291def9f55cb'
AND (
token = 'ihZ+xy0PxU7G8hPlxV/klZTn/w5a8GexOaesYwqpGaA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)