UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CVtv0Sew9KqPMgs21lH7ViIF0g5lDG6Dsk7U/S3JJVE='
WHERE
key_id = '9067833433585a0f548d0bfc845e3a1c7773c6a3f162fb2a04f10f4852c687d8'
AND (
token = 'CVtv0Sew9KqPMgs21lH7ViIF0g5lDG6Dsk7U/S3JJVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)