UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j8wAWaNzrk/ES51ZfsR723ZBZur09UN3DVDhpMwQG5s='
WHERE
key_id = 'ccb23cb4561052553e376e5c7a4011d961fa17dd8d8742ee2cede405ea0c002b'
AND (
token = 'j8wAWaNzrk/ES51ZfsR723ZBZur09UN3DVDhpMwQG5s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)