UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wmat822xXeO/ocaUsoFmUvYT6tF8TvcHEwruXsgXtfI='
WHERE
key_id = 'ed4b9f3dd3d6b4cbf84af4308ede1b88ec26124bd71bd7e41ee1a59301cac337'
AND (
token = 'Wmat822xXeO/ocaUsoFmUvYT6tF8TvcHEwruXsgXtfI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)