UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DcLMjRQAJIdazEVmRYTceEK+CPEYNcIJ/KAcNYcRxYI=' 
WHERE 
  key_id = '68f32aafbca7512d16c473ca461cb90af69de807d1da80db088060f01a91a784' 
  AND (
    token = 'DcLMjRQAJIdazEVmRYTceEK+CPEYNcIJ/KAcNYcRxYI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016