UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JkkMEfTDMu1ZvrgUpmW9AiOigqSOdbEYVuG/K5sFSk0=' 
WHERE 
  key_id = '7c28e61e8a6d6c74a0da90fd283319e99989cf4efa6981696b002cb807d83942' 
  AND (
    token = 'JkkMEfTDMu1ZvrgUpmW9AiOigqSOdbEYVuG/K5sFSk0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029