UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ojuhHu30DUFalE/2WYxHbb2ti7ElZGFfIqZ0e8KTl6g='
WHERE
key_id = '310c71113d98b8cb73f671c1c57a8c4a3bfbbc67b226bc13dfb825703f7db7b9'
AND (
token = 'ojuhHu30DUFalE/2WYxHbb2ti7ElZGFfIqZ0e8KTl6g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)