UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZZWMdq4a+ld7g3pL9NOWjiqOgnahCRvudymFgzWd3nE='
WHERE
key_id = 'b8b86a43b2f9d7d0684d2d0395c80ed5fcc8d15c7206369b2514574ac6cc8dee'
AND (
token = 'ZZWMdq4a+ld7g3pL9NOWjiqOgnahCRvudymFgzWd3nE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)