UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hr8/S3El7PkdTGp8Qou2SSK73W0FVgiG2HTSJiayiAc=' 
WHERE 
  key_id = '2369228240abc19c365b7bf6b1e5de09d9d50a8403ac3f48e98ee966266ccc3f' 
  AND (
    token = 'Hr8/S3El7PkdTGp8Qou2SSK73W0FVgiG2HTSJiayiAc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061