UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qVXlG19wHP9nqhBsLPwlhOyGFC9zzjPmHHBYwlnKeYI=' 
WHERE 
  key_id = '2acc47c8e7cac479a4e1929c4ec85b2761393aa174ae2bc8704ca013db4c0454' 
  AND (
    token = 'qVXlG19wHP9nqhBsLPwlhOyGFC9zzjPmHHBYwlnKeYI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046