UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cpLGPfTQKHbqUCLyqrpuHJ39SdO6g4r/UEa/VRkwGxk=' 
WHERE 
  key_id = 'abc605655e9f28cd0a75d5091c8d10a0039c226eaa79e02c3fccee41c97ed53f' 
  AND (
    token = 'cpLGPfTQKHbqUCLyqrpuHJ39SdO6g4r/UEa/VRkwGxk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023