UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rCIKCaYCJhFpcJa1Q165Zvx3dZ9ky5X8PgUd+p15Izg='
WHERE
key_id = 'e5cf760cf1c1b7a3bcfae43ffe88882e5ca9503bfa02e0ddc2220d32541ae8f1'
AND (
token = 'rCIKCaYCJhFpcJa1Q165Zvx3dZ9ky5X8PgUd+p15Izg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)