UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4wQ0kCmzrxwoDYalOAdnEojaEvXIe5AnWN0mfCPtbgQ=' 
WHERE 
  key_id = '99ddf4fd4582f71b4be79d46aca8f8e694e955ccc0eb13f872b1c30bebfed10d' 
  AND (
    token = '4wQ0kCmzrxwoDYalOAdnEojaEvXIe5AnWN0mfCPtbgQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032