UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GLB7or8sxwBqqFKQ3crDo8xz7z22rVyFyWIGU5iB/dg='
WHERE
key_id = '8bc35bea117debe2508eb7c7e3be7b01b4620cc1119e40d849720b0c20fb4801'
AND (
token = 'GLB7or8sxwBqqFKQ3crDo8xz7z22rVyFyWIGU5iB/dg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)