UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UWFpcvKjx2nZebWBZBDwMMjEQ2L4q74r0TSWwWHT5wA='
WHERE
key_id = '209ae966f2336006b23c258b34b8c6d80f97d6d7211e15281a222c60275631e5'
AND (
token = 'UWFpcvKjx2nZebWBZBDwMMjEQ2L4q74r0TSWwWHT5wA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)