UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '67pvjyKowIChhxkWSPO+AIDsLGcWEGc2Ls6b3xlT5Bs=' 
WHERE 
  key_id = 'baaadcffaa6f579ec907f96f49215d875b1402e48c4b7fa842ca3e07692d6193' 
  AND (
    token = '67pvjyKowIChhxkWSPO+AIDsLGcWEGc2Ls6b3xlT5Bs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021