UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/j47fHrtrda51/GMNA3RHB9w+NjHq9HHut2ivXXnQD4='
WHERE
key_id = 'b9fcca4d0a8fa48ea372784486b89232a5da64b04977f50ed1913ed347c10c8a'
AND (
token = '/j47fHrtrda51/GMNA3RHB9w+NjHq9HHut2ivXXnQD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)