UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y13cD6vK5Yvf219psM4zBsH3qdK7PvZ2gXskxIxQIxE='
WHERE
key_id = '184d5557c69e5245b18114c9d4f5cf87c407f1cc6e5e9876c1d47f2c5cd5d960'
AND (
token = 'Y13cD6vK5Yvf219psM4zBsH3qdK7PvZ2gXskxIxQIxE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)