UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wLH2dVD5LJL0rrNJJBn957hl9hV+7rmGvteatWIeI2w=' 
WHERE 
  key_id = 'feb954488bfe4f9c765b07f5a3e540eb5f977b14a5920aed1ba301813ca13f37' 
  AND (
    token = 'wLH2dVD5LJL0rrNJJBn957hl9hV+7rmGvteatWIeI2w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021