UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DS8d/L+JteW8Y0ffYUjbxV82aibacG2B4o3DW2iJYdI=' 
WHERE 
  key_id = '53811637faffbf02635e013d0002c598669a47838ca5c11c55d7993f52184b49' 
  AND (
    token = 'DS8d/L+JteW8Y0ffYUjbxV82aibacG2B4o3DW2iJYdI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024