UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JBLC3KE3TwKFCHTU2SOG3HcP+9k0Mpuf40Azh0o3YEU='
WHERE
key_id = '75918270ecf1dadbb9aafb653dec57432fb90b3b81b04fa737c82bf05e02b2a2'
AND (
token = 'JBLC3KE3TwKFCHTU2SOG3HcP+9k0Mpuf40Azh0o3YEU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)