UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ax9UCJkQV08QYEvljraUMcBhv9SZqIguiJI2RU006vI='
WHERE
key_id = 'df0e58a5c564b781c0c94092b5d56632c5c65ea562110ade505542ff45788db2'
AND (
token = 'Ax9UCJkQV08QYEvljraUMcBhv9SZqIguiJI2RU006vI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)