UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A1uklhDVj7qNIU9BvDhnYwa/bOYXEY4GVgmMUz0xlaw=' 
WHERE 
  key_id = '9c975b570e5762afec5415805cea02e33ee8244f68d8dd9b4dde9176ba6d44eb' 
  AND (
    token = 'A1uklhDVj7qNIU9BvDhnYwa/bOYXEY4GVgmMUz0xlaw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00159