UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5TU8YayuokSxjfCIIFwBXWQpQemzL2QSZBznaSuXHso='
WHERE
key_id = '1f7e9973a04995d942c1faeabce601d682d4e8d1b84b8fac3d0441ba1f612aca'
AND (
token = '5TU8YayuokSxjfCIIFwBXWQpQemzL2QSZBznaSuXHso='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)