UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/5fp1kqiXxSOiBXwVkB46rDms2tnVhW2d1UCxNlez5k=' 
WHERE 
  key_id = '62f98e80ecfae30d7bd6a5fe846d12d32f52609fb5c190957bd81fd1e673ddd0' 
  AND (
    token = '/5fp1kqiXxSOiBXwVkB46rDms2tnVhW2d1UCxNlez5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00145