UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BFp8VRd8U/AmLmtfrk1xq8zgx0ia1Y2a6eeI1Mt0cUU=' 
WHERE 
  key_id = '6ed14459d08a6d28cd14e702a15b4c3a839734a3e3130db5a7eef5da5a06f309' 
  AND (
    token = 'BFp8VRd8U/AmLmtfrk1xq8zgx0ia1Y2a6eeI1Mt0cUU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028